import 'package:flutter/material.dart';
import 'package:hkzf/pages/home/info/index.dart';
import 'package:hkzf/pages/home/tab_index/index_navigator.dart';
import 'package:hkzf/pages/home/tab_index/index_recommend.dart';
import 'package:hkzf/widgets/common_swiper.dart';
import 'package:hkzf/widgets/seach_bar/index.dart';

class TabIndex extends StatelessWidget {
  const TabIndex({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var height = MediaQuery.of(context).size.width / 350 * 150;
    return Scaffold(
      appBar: AppBar(
        title: SearchBar(
          showLoaction: true,
          showMap: true,
          onSearch: () {
            Navigator.pushNamed(context, '/search');
          },
        ),
        backgroundColor: Colors.white,
      ),
      body: ListView(children: [
        // 轮播图
        Container(
          height: height,
          child: CommonSwiper(),
        ),
        // 导航图
        IndexNavigator(),
        IndexRecommend(),
        Info(
          showTitle: true,
        )
      ]),
    );
  }
}
